﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using Digitalmes.Model.ReworkManagement;
using Digitalmes.Model;

namespace Digitalmes.ViewModel.ReworkManagement.ReworkDataVMs
{
    public partial class ReworkDataTemplateVM : BaseTemplateVM
    {
        
        [Display(Name = "_Model._ReworkData._ProductId")]
        public ExcelPropety ProductId_Excel = ExcelPropety.CreateProperty<ReworkData>(x => x.ProductId);
        [Display(Name = "_Model._ReworkData._ProductName")]
        public ExcelPropety ProductName_Excel = ExcelPropety.CreateProperty<ReworkData>(x => x.ProductName);
        [Display(Name = "_Model._ReworkData._ReType")]
        public ExcelPropety ReType_Excel = ExcelPropety.CreateProperty<ReworkData>(x => x.ReTypeId);
        [Display(Name = "_Model._ReworkData._ReTypeDesc")]
        public ExcelPropety ReTypeDesc_Excel = ExcelPropety.CreateProperty<ReworkData>(x => x.ReTypeDesc);
        [Display(Name = "_Model._ReworkData._ReasonName")]
        public ExcelPropety ReasonName_Excel = ExcelPropety.CreateProperty<ReworkData>(x => x.ReasonName);
        [Display(Name = "_Model._ReworkData._ReasonCode")]
        public ExcelPropety ReasonCode_Excel = ExcelPropety.CreateProperty<ReworkData>(x => x.ReasonCode);
        [Display(Name = "_Model._ReworkData._Remark")]
        public ExcelPropety Remark_Excel = ExcelPropety.CreateProperty<ReworkData>(x => x.Remark);
        [Display(Name = "_Model._ReworkData._WoId")]
        public ExcelPropety WoId_Excel = ExcelPropety.CreateProperty<ReworkData>(x => x.WoId);
        [Display(Name = "_Model._ReworkData._WoCode")]
        public ExcelPropety WoCode_Excel = ExcelPropety.CreateProperty<ReworkData>(x => x.WoCode);
        [Display(Name = "_Model._ReworkData._Sn")]
        public ExcelPropety Sn_Excel = ExcelPropety.CreateProperty<ReworkData>(x => x.Sn);
        [Display(Name = "_Model._ReworkData._Operation")]
        public ExcelPropety Operation_Excel = ExcelPropety.CreateProperty<ReworkData>(x => x.Operation);
        [Display(Name = "_Model._ReworkData._Data")]
        public ExcelPropety Data_Excel = ExcelPropety.CreateProperty<ReworkData>(x => x.Data);
        [Display(Name = "_Model._ReworkData._CreateTime")]
        public ExcelPropety CreateTime_Excel = ExcelPropety.CreateProperty<ReworkData>(x => x.CreateTime, true);
        [Display(Name = "_Model._ReworkData._UpdateTime")]
        public ExcelPropety UpdateTime_Excel = ExcelPropety.CreateProperty<ReworkData>(x => x.UpdateTime, true);
        [Display(Name = "_Model._ReworkData._CreateBy")]
        public ExcelPropety CreateBy_Excel = ExcelPropety.CreateProperty<ReworkData>(x => x.CreateBy);
        [Display(Name = "_Model._ReworkData._UpdateBy")]
        public ExcelPropety UpdateBy_Excel = ExcelPropety.CreateProperty<ReworkData>(x => x.UpdateBy);
        [Display(Name = "_Model._ReworkData._IsValid")]
        public ExcelPropety IsValid_Excel = ExcelPropety.CreateProperty<ReworkData>(x => x.IsValid);
        [Display(Name = "_Model._ReworkData._TenantCode")]
        public ExcelPropety TenantCode_Excel = ExcelPropety.CreateProperty<ReworkData>(x => x.TenantCode);

	    protected override void InitVM()
        {
            
            ReType_Excel.DataType = ColumnDataType.ComboBox;
            ReType_Excel.ListItems = DC.Set<ReworkType>().GetSelectListItems(Wtm, y => y.TenantCode.ToString());

        }

    }

    public class ReworkDataImportVM : BaseImportVM<ReworkDataTemplateVM, ReworkData>
    {
            //import

    }

}